import request from '@/utils/request.js'

//获取自家店的信息
export function apiGetOwnStoreDetail(){
	return request({
		url:'/store/own/detail',
		method:'get'
	})
}

// 查看自己是否有店
export function apiExistOwnStore(){
	return request({
		url:'/store/own/hasStore',
		method:'get'
	})
}

// 查看商店列表
export function apiGetStoreList(data){
	return request({
		url:'/store/list',
		method:'post',
		data:data
	})
}

// 查看列表详情
export function apiGetStoreDetail(params){
	return request({
		url:'/store',
		method:'get',
		params:params
	})
}
// 更新商店信息
export function apiEditStore(data){
	return request({
		url:'/store',
		method:'put',
		data:data
	})
}
// 通过审核
export function apiEditStorePassAudit(data){
	return request({
		url:'/store/passAudit',
		method:'put',
		data:data
	})
}
// 未通过审核
export function apiEditStoreNoPassAudit(data){
	return request({
		url:'/store/noPassAudit',
		method:'put',
		data:data
	})
}
// 已停运
export function apiEditStoreStoped(data){
	return request({
		url:'/store/stoped',
		method:'put',
		data:data
	})
}
// 删除商店
export function apiDelStore(id){
	return request({
		url:'/store/delete/'+id,
		method:'delete'
	})
}
// 通过商品查商店
export function apiGetStoreByProdId(params){
	return request({
		url:'/store/selectByProdId',
		method:'get',
		params:params
	})
}
// 新增
export function apiAddStore(data){
	return request({
		url:'/store',
		method:'post',
		data:data
	})
}
// 批量删除
export function apiDelStores(ids){
	return request({
		url:'/store/delete/'+ids,
		method:'delete',
	
	})
}
// 通过商家Id查商店
export function apiGetStoreByUserId(params){
	return request({
		url:'/store/selectByUserId',
		method:'get',
		params:params
	})
}
// 获取商店的商品总数
export function apiCountStore(params){
	return request({
		url:'store/prod/total',
		method:'get',
		params:params
	})
}